Call:
lm(formula = frequency_score ~ group, data = sample)
Coefficients:
(Intercept) groupsquare
78.50 -8.85
What if I want to know the relationship bead shape and the frequency score?
How can we quantify how much we’d expect the difference in means to differ from one random sample to another?
\[ \Large \bar{y}_{circle} - \bar{y}_{square} \]
\[ \Large y = \beta_0 + \beta_1(group == square) + \varepsilon \]
\[ \Large \hat{y} = \hat\beta_0 + \hat\beta_1(group == square) \]
How can we quantify how much we’d expect the slope to differ from one random sample to another?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
We need a test statistic that incorporates \(\hat{\beta}_1\) and the standard error
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
How do we interpret this?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
How do we know what values of this statistic are worth paying attention to?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
How do get a confidence interval for \(\hat{\beta}_1\)? What function can we use in R?
How do we interpret this value?
Application Exercisefrequency_score and group in your data05:00
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
Is \(\hat\beta_1\) different from 0?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
Is \(\beta_1\) different from 0? (notice the lack of the hat!)
The probability of observing a statistic as extreme or more extreme than the observed test statistic given the null hypothesis is true
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
What is the p-value? What is the interpretation?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-61.650 -15.500 -3.075 21.350 57.350
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 78.500 7.669 10.235 1.78e-12 ***
groupsquare -8.850 10.846 -0.816 0.42
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.3 on 38 degrees of freedom
Multiple R-squared: 0.01722, Adjusted R-squared: -0.008644
F-statistic: 0.6658 on 1 and 38 DF, p-value: 0.4196
Do we reject the null hypothesis?
Application Exerciseappex-06.qmdfrequency_score and group with your data02:00